package com.tengju.motivation.domain.shared;


import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: 李大仙
 * @Date: 2021/5/6 4:43 下午
 */
public enum PerformanceObjectiveType {

    SALES_REACHED("salesReached", "销售额(GMV)", "销售额(GMV)"),
    DEALER_REACHED("dealerReached", "经销商招募达成", "经销商招募"),
    SERVICE_PROVIDER_REACHED("serviceProviderReached", "服务商晋升达成", "服务商晋升"),
    SERVICE_PROVIDER_1_STAR_REACHED("serviceProvider1StarReached", "1星服务商晋升达成", "1星服务商晋升"),
    SERVICE_PROVIDER_2_STAR_REACHED("serviceProvider2StarReached", "2星服务商晋升达成", "2星服务商晋升"),
    SERVICE_PROVIDER_3_STAR_REACHED("serviceProvider3StarReached", "3星服务商晋升达成", "3星服务商晋升"),
    SERVICE_PROVIDER_4_STAR_REACHED("serviceProvider4StarReached", "4星服务商晋升达成", "4星服务商晋升"),
    EC_REACHED("ecReached", "EC晋升达成", "EC晋升"),
    SEC_REACHED("secReached", "SEC晋升达成", "SEC晋升"),
    EEC_REACHED("eecReached", "EEC晋升达成", "EEC晋升"),
    SVIP_REACHED("svipReached", "黑钻新增", "黑钻新增"),
    VVIP_REACHED("vvipReached", "白金新增", "白金新增"),
    VIP_REACHED("vipReached", "粉卡新增", "粉卡新增"),
    MONEY_OUT("moneyOut", "出货额达成", "出货额"),
    DEALER_REACHED_INTEGRAL("dealerReachedIntegral", "经销商招募(积分)达成", "经销商招募(积分)"),
    DEALER_REACHED_RECHARGE("dealerReachedRecharge", "经销商招募(充值)达成", "经销商招募(充值)"),
    SVIP_REACHED_INTEGRAL("svipReachedIntegral", "黑钻招募(积分)达成", "黑钻招募(积分)"),
    SVIP_REACHED_GIFT("svipReachedGift", "黑钻招募(礼包)达成", "黑钻招募(礼包)"),
    VVIP_REACHED_INTEGRAL("vvipReachedIntegral", "白金招募(积分)达成", "白金招募(积分)"),
    VVIP_REACHED_GIFT("vvipReachedGift", "白金招募(礼包)达成", "白金招募(礼包)"),
    VIP_REACHED_INTEGRAL("vipReachedIntegral", "粉卡招募(积分)达成", "粉卡招募(积分)"),
    VIP_REACHED_GIFT("vipReachedGift", "粉卡招募(礼包)达成", "粉卡招募(礼包)"),
    MONTH_PROFIT_THREE_THOUSAND("profitThreeThousand","月入3000+","月入3000+"),
    ;

    String code;
    String desc;
    String targetDesc;


    PerformanceObjectiveType(String code, String desc, String targetDesc) {
        this.code = code;
        this.desc = desc;
        this.targetDesc = targetDesc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getTargetDesc() {
        return targetDesc;
    }

    public static PerformanceObjectiveType getByCode(String code) {
        return Arrays.stream(PerformanceObjectiveType.values())
                .filter(k -> k.getCode().equals(code))
                .findFirst().orElse(null);
    }

    public static PerformanceObjectiveType getByTargetDesc(String targetDesc) {
        return Arrays.stream(PerformanceObjectiveType.values())
                .filter(k -> k.getTargetDesc().equals(targetDesc))
                .findFirst().orElse(null);
    }

    public static List<String> getTargetDescList() {
        return Arrays.stream(PerformanceObjectiveType.values())
                .map(PerformanceObjectiveType::getTargetDesc)
                .collect(Collectors.toList());
    }
}
